/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-05-14
 * Time: 16:10
 */

public class LightOffCommand implements Command{

    //聚合LightReceiver
    LightReceiver light;

    //没有构造器 light就是空的
    public LightOffCommand(LightReceiver light){
        super();
        this.light = light;
    }

    //执行就是关闭了
    @Override
    public void execute() {
        //
        light.off();
    }

    //
    @Override
    public void undo() {
        //
        light.on();
    }
}
